# def mod_exp(base, exp, mod):
#     return pow(base, exp, mod)
#
# r = 1357
# i = 10
#
# # 找到 e1
# e1 = None
# for k in range(1, 1000):
#     if mod_exp(i, k, r) == 419:
#         e1 = k
#         break
#
# # 找到 e2
# e2 = None
# for k in range(1, 1000):
#     if mod_exp(i, k, r) == 34:
#         e2 = k
#         break
#
# # 验证 e1 和 e2
# if e1 is not None and e2 is not None:
#     product = e1 * e2
#     if mod_exp(i, product, r) == 33:
#         print(f"e1 = {e1}, e2 = {e2} ")
#     else:
#         print("e1 and e2 found, but product check failed.")
# else:
#     print("Failed to find e1 or e2.")
